package com.bluedot.bank.action;

import java.util.Iterator;
import java.util.Map;
import java.util.Set;

import com.bluedot.bank.dao.privilege.Privilege;
import com.bluedot.bank.dao.user.User;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class ATMFilterAction extends ActionSupport {
	@Override
	public String execute() throws Exception {
		Map session=ActionContext.getContext().getSession();
		User user=(User)session.get("user");
		Set<Privilege> set=user.getRole().getPrivileges();
		Iterator<Privilege> iterator=set.iterator();
		while(iterator.hasNext()){
			if("ATM管理".equals(iterator.next().getPrivilegeName()))
				return SUCCESS;
		}
		return "noPrivilege";
		
	}
}
